package com.lanhe.app.controller.member;


import com.lanhe.common.core.controller.BaseController;
import com.lanhe.common.core.domain.AjaxResult;
import com.lanhe.common.core.domain.entity.LhMemberBase;
import com.lanhe.member.service.ILhMemberBaseService;
import com.lanhe.product.service.ILhLevelInfoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 等级表(LhLevelInfo)表控制层
 *
 * @author zhanggl
 * @since 2024-01-04 20:23:39
 */
@RestController
@RequestMapping("/api/levelInfo/")
public class ApiLevelInfoController extends BaseController {

	/**
	 * 服务对象
	 */
	@Resource
	private ILhLevelInfoService lhLevelInfoService;

	/**
	 * 服务对象
	 */
	@Resource
	private ILhMemberBaseService lhMemberBaseService;

    /**
     * 获取可购买的等级数据
     *
     * @return com.lanhe.product.domain.LhLevelInfo
     * @author zhanggl
     * @date 2024/1/4
     */
	@GetMapping("getLeveInfoProduct")
	public AjaxResult getLeveInfoProduct() {

		LhMemberBase memberBase = lhMemberBaseService.getById(getUserId());
		return success(lhLevelInfoService.getLeveInfoProduct(memberBase.getLeaderLevel()));
	}

}

